<template>
    <div>
        <h1>student</h1>
        <el-table
                :data="students"
                border
                style="width: 100%">
            <div v-for="(col,i) in cols" :key="i">
            <el-table-column
                    :prop="col.prop"
                    :label="col.label"
                    width="140">
            </el-table-column>
        </div>
        </el-table>
    </div>

</template>

<script>
    // eslint-disable-next-line no-unused-vars
    import cons from "../common/Cons";
    export default {
        // eslint-disable-next-line vue/multi-word-component-names
        name: "Student",
        data(){
            return {
                cols: [
                    {prop:"studentId",label:"序号"},
                    {prop:"studentClassId",label:"班级"},
                    {prop:"studentNumber",label:"学号"},
                    {prop:"studentName",label:"姓名"},
                    {prop:"studentPassword",label:"密码"},
                    {prop:"studentEmail",label:"邮箱"},
                    {prop:"studentBirthday",label:"生成日期"},
                    {prop:"studentSex",label:"性别"},
                    {prop:"studentLastLoginTime",label:"最后登录时间"},
                ],
                students:[]
            }
        },
        methods:{
            getStudentList(){
                let vm = this;
                vm.$axios({
                    method:"get",
                    url:cons.baseUrl+"/rcStudent/list"
                }).then(res=>{
                  let data = res.data;
 //                 vm.students=data.data;
//                    console.log(res);
                    vm.students=data.data;
                })
            }
        },
        created(){
            this.getStudentList();
        }
    }
</script>

<style scoped>

</style>